<% content_for :header do %>
<div id="nav">
  <ul>
    <li><a href="/intro">活动介绍</a></li>
    <li><a href="/join">如何参与</a></li>
    <li><a href="/news" class="current">最新动态</a></li>
    <li><a href="/contact">联系我们</a></li>
  </ul>
</div>
<div id="pagetitle">
  <h1>最 新 动 态</h1>
</div>
<% end %>

<div id="content" class="wp">
    <h2>参加多背一公斤爱心公益助学计划</h2>
    <em>当你在家中时</em>
    <ol class="ol2">
      <li>查询 <a href="/stores">Kolumb 全国募集站</a></li>
      <li>将图书或文具送到募集站</li>
      <li>在网站上分享你的想法</li>
      <li>收到“一公斤”爱心贵宾卡</li>
    </ol>
    <em>当你要旅行时</em>
    <ol class="ol2">
      <li><a href="/schools">查询多背一公斤学校</a></li>
      <li>下载<a href="/1kg_school_info_sheet.xls">学校信息表</a>和<a href="/1kg_program_info_sheet.xls">活动记录表</a></li>
      <li>多背一公斤出行</li>
      <li>在网站上分享旅行探访感受</li>
    </ol>
    
    <h2>大家的多背一公斤出行计划 ...</h2>
    <div>
    <% for t in @tours -%>
      <p><%= link_to "#{show_date t.start_at} 到 #{show_date t.end_at}，从 #{h t.start_place} 到 #{h t.end_place}", tour_path(t) %></p>
    <% end -%>
    </div>
    
    <h2>大家在多背一公斤做什么 ... <%= link_to "查看全部留言", :controller => 'broadcasts', :action => 'index' %></h2>
    <div><% for b in @broadcasts -%>
      <% color = %w(orange purple red blue green) %>
      <p><span style="color:<%= color[rand(color.size)]%>">
        <% if b.from == 0 -%>
          <%= b.content %>
        <% else -%>
          <%= h b.content %>
        <% end -%>
      </span>
      <span class="sysmsg"><img src="/images/comment.png" /> <%= "by #{link_to b.sender.login, user_path(b.sender)}" unless b.from==0 %> <%= show_datetime b.created_at %></span></p>
    <% end -%></div>
    <div id="post-comment" class="p">
      <div class="comment-tl"><img src="/images/comment_add.png" /> 我想说两句</div>
      <% form_for :broadcast, :url => {:controller => 'broadcasts', :action => 'create'} do |f| %>
        <%= f.text_area :content, :rows=>5 %>
        <p><%= submit_tag "发送" %></p>
      <% end -%>
    </div>
</div>
